package com.webshopping.service.goods;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.webshopping.entry.AttributeMetadata;
import com.webshopping.mapper.AttrMetaDataMapper;
import com.webshopping.tag.TagFactory;


@Service
public class AttributeMetaDataService {

	@Autowired
	private AttrMetaDataMapper attrMateDataMapper;
	
	public List<AttributeMetadata> queryByType(int goodsTypeId){
		return attrMateDataMapper.queryByType(goodsTypeId);
	}
	
	public List<String> getTagsByType(int goodsTypeId){
		List<String> tags = TagFactory.getTagByAttrMateData(queryByType(goodsTypeId));
		return tags;
		
	}
	
	public int add(AttributeMetadata attMd){
		return attrMateDataMapper.add(attMd);
	}
}
